package com.singzi.testCase;

import org.junit.Rule;
import org.junit.Test;

import java.util.Arrays;
import java.util.Scanner;

public class StringTest {
    public static void main(String[] args) {

         Scanner M =new Scanner(System.in);
         String str = M.nextLine();  //nextLine 输出带空格的字符串
         int o = M.nextInt();  //nextLine 输出带空格的字符串
         System.out.println(str);


    }

    @Test
    public void asiiTest(){
        char a = 'a';
        System.out.println((int) a);
    }
    public static boolean equalStr(String s1, int start, int end){
        int i = start, j = end;
        while(i<j){
            if(s1.charAt(i)!=s1.charAt(j))
                return false;
            i++;
            j--;

        }
        return true;
    }
    @Test
    public void spaceTest(){
        String s = "how are u";
        for (int i = 0; i < s.length(); i++) {
            if(s.charAt(i) == ' '){
                System.out.println(i);
            }
        }
    }
    @Test
    public void asiiT1(){
        String s = "abc";
        System.out.println(s.charAt(0) + 1);
    }
    @Test
    public void modifyChar(){
        String s = "abc";
        char[] temp = s.toCharArray();
        temp[1] = (char) (97);
        s = new String(temp);
        System.out.println(s);
        System.out.println((int) 'c');
    }
    @Test
    public void asiiChar(){
        System.out.println((char) 102);
    }
    @Test
    public void StringToInt(){
        String a = "-9000";
        System.out.println(Integer.parseInt(a));
    }
    @Test
    public void equalTest() {
        String s1 = "123";
        String s2 = "123";
        System.out.println(s1 == s2);
        System.out.println(s1.equals(s2));
    }
    @Test
    public void addTest(){
        String s = "123";
        String s1 = s + "123";
        s = "134";
        System.out.println(s);
        System.out.println(s1);
    }
    @Test
    public void createString(){
        String[]ss = new String[2];
        System.out.println(Arrays.toString(ss));
    }
    @Test
    public void subTest(){
        String s1 = "0123456789";
        System.out.println(s1.substring(0, 5));
    }
    @Test
    public void inTest(){
        Scanner M =new Scanner(System.in);
        String str = M.nextLine();  //nextLine 输出带空格的字符串
        System.out.println(str);
    }
    @Test
    public void buildTest(){
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("123");
        stringBuilder = new StringBuilder();
        stringBuilder.append("345");
        System.out.println(stringBuilder);
    }
    @Test
    public void StrToInt(){
        String s = "12$";
        try {
            int a = Integer.parseInt(s);  //异常点
            System.out.println(a);
        } catch (Exception e) {
//            e.printStackTrace();
            System.out.println("s");
        }

    }
    @Test
    public void sbTes(){
        String s = "";
        StringBuilder sb = new StringBuilder();
        StringBuffer stringBuffer = new StringBuffer();
        sb.append("123");
        stringBuffer.append("123");


    }
    @Test
    public void test03(){
        String s;
//        System.out.println(" s= " + s);
    }
    @Test
    public void test04(){
        int []dp = new int[100];
        dp[0] = 0;
        dp[1] = 1;
        for (int i = 2; i < 100; i++) {
            dp[i] = dp[i-1] + dp[i -2];
        }
        System.out.println(dp[10]);
    }

}
